NumericText (str)

NumericText and IsNumeric (str) are equivalent functions. However, NumericText is preferred in Crystal syntax, whereas IsNumeric is preferred in Basic syntax.

Arguments

str is a text string being tested for numeric text.

Returns

Boolean Value

Action

NumericText tests to see if the content of a text object is a Number.

Typical uses

If you store numbers (like weight) in a text object, use NumericText to check the value of each record to make sure it is OK to convert using ToNumber (numeric), ToNumber (string), ToNumber (Boolean).

Examples

The following examples are applicable to both Basic and Crystal syntax, although IsNumeric is preferred in the latter:

NumericText({file.REFERENCE})

Returns FALSE where {file.REFERENCE} = "ABCDEFG".

NumericText({file.IDNUM})

Returns TRUE where {file.IDNUM} = "12345".

NumericText({file.IDNUM})

Returns TRUE where {file.IDNUM} = "12345443".

NumericText({file.IDNUM})

Returns FALSE where {file.IDNUM} = "12345-443".

NumericText ({file.IDNUM} [1 to 5])

Returns TRUE where {file.IDNUM} = "12345-443".

NumericText ({file.IDNUM} [6])

Returns FALSE where {file.IDNUM} = "12345-443".

NumericText ({file.IDNUM} [7 to 9])

Returns TRUE where {file.IDNUM} = "12345-443".

NumericText({file.IDNUM})

Returns FALSE where {file.IDNUM} = "12345T".

Note:    You can use this function in combination with ToNumber (numeric), ToNumber (string), ToNumber (Boolean) to test for a Number in the Reference field, then print the string as a Number or print 0 if the text string is not a Number.

The following example is applicable to Crystal syntax:

If NumericText({file.REFERENCE}) Then

    ToNumber({file.REFERENCE})

Else

    0;

Related topics

Formula 9



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com